#include <cstdio>

long long f[] = {0LL,1LL,4LL,12LL,24LL,36LL,60LL,192LL,120LL,180LL,240LL,576LL,360LL,1296LL,900LL,720LL,840LL,9216LL,1260LL,786432LL,1680LL,2880LL,15360LL,3600LL,2520LL,6480LL,61440LL,6300LL,6720LL,2359296LL,5040LL,3221225472LL,7560LL,46080LL,983040LL,25920LL,10080LL,206158430208LL,32400LL,184320LL,15120LL,44100LL,20160LL,5308416LL,107520LL,25200LL,2985984LL,9663676416LL,27720LL,233280LL,45360LL,2949120LL,430080LL,129600LL,50400LL,414720LL,60480LL,11796480LL,339738624LL,921600LL,55440LL,60466176LL,16106127360LL,100800LL,83160LL,1658880LL,322560LL,191102976LL,176400LL,188743680LL,181440LL,633318697598976LL,110880LL,21743271936LL,1166400LL,226800LL};

int main( )
{
    int n;
    while ( scanf("%d", &n) && n )
        printf("%I64d\n", f[ n ]);
    return 0;
}
